<nz-modal [(nzVisible)]="isVisible"
          [nzWidth]="560"
          (nzOnCancel)="handleCancel()"
          [nzOkLoading]="isOkLoading"
          (nzAfterOpen)="renderCode()"
          [nzFooter]="null"
>
<div class="containers">
  <div class="box" *ngFor="let item of merchantList; let i = index">
    <text class="title">{{item.certificationChannels==0?'支付宝':'微信'}}</text>
    <div *ngIf="item.certificationChannels==0 && item.merchantId!=null
        && (item.aliApplymentState==aliApplymentStateEnum.AUDITING || item.aliApplymentState==aliApplymentStateEnum.CONTACT_PROCESSING ||
            item.aliApplymentState==aliApplymentStateEnum.CONTACT_CONFIRM || item.aliApplymentState==aliApplymentStateEnum.LEGAL_CONFIRM) ||
           (item.aliApplymentState==aliApplymentStateEnum.AUDIT_FREEZE && item.aliQrcode!=null)">
      <img  class="qr-code" nz-image [nzSrc]="item.aliQrcode"
            width="104px"
            height="104px"/>
    </div>
    <div  class="qr-code"  id="qrcode{{item.certificationChannels}}"
        *ngIf="item.certificationChannels==0 && (
        (item.aliApplymentState==aliApplymentStateEnum.AUDIT_REJECT || item.aliApplymentState==aliApplymentStateEnum.CANCELED) ||
        (item.aliApplymentState==aliApplymentStateEnum.AUDIT_FREEZE && item.aliQrcode==null) || item.aliApplymentState===null)">
    </div>
    <div *ngIf="item.certificationChannels==1 && item.merchantId!=null
        && (item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_WAITTING_FOR_AUDIT || item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_EDITTING ||
            item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_WAITTING_FOR_CONFIRM_CONTACT || item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_WAITTING_FOR_CONFIRM_LEGALPERSON) ||
            (item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_FREEZED && item.qrcodeData!=null)">
      <img  class="qr-code" nz-image [nzSrc]="base64(item.qrcodeData)"
            width="104px"
            height="104px"/>
    </div>
    <div class="qr-code"  id="qrcode{{item.certificationChannels}}"
      *ngIf="item.certificationChannels==1 && (
      (item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_REJECTED || item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_CANCELED) ||
      (item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_FREEZED && item.qrcodeData==null) || item.weChatApplymentState===null)">
    </div>
    <div class="text-containers">
      <div class="text-box">
        <text>认证审核状态：</text>
        <div *ngIf="item.certificationChannels==0">
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.AUDITING">
            审核中
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.CONTACT_PROCESSING">
            联系人处理中
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.CONTACT_CONFIRM">
            待联系人确认
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.LEGAL_CONFIRM">
            待法人确认
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.AUDIT_PASS">
            审核通过
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.AUDIT_REJECT">
            审核失败
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.AUDIT_FREEZE">
            已冻结
          </text>
          <text *ngIf="item.aliApplymentState==aliApplymentStateEnum.CANCELED">
            已撤回
          </text>
          <text *ngIf="item.aliApplymentState==null">
            无
          </text>
        </div>
        <div *ngIf="item.certificationChannels==1">
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_WAITTING_FOR_AUDIT">
            审核中
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_EDITTING">
            编辑中
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_WAITTING_FOR_CONFIRM_CONTACT">
            待确认联系信息
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_WAITTING_FOR_CONFIRM_LEGALPERSON">
            待账户验证
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_PASSED">
            审核通过
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_REJECTED">
            审核驳回
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_FREEZED">
            已冻结
          </text>
          <text *ngIf="item.weChatApplymentState==applymentStateEnum.APPLYMENT_STATE_CANCELED">
            已作废
          </text>
          <text *ngIf="item.weChatApplymentState==null">
            无
          </text>
        </div>
      </div>
      <div class="text-box">
        <text>授权状态：</text>
        <div *ngIf="item.certificationChannels==0">
          <text *ngIf="item.aliAuthorizeState=='AUTHORIZED'">已授权</text>
          <text *ngIf="item.aliAuthorizeState=='UNAUTHORIZED'">未授权</text>
        </div>
        <div *ngIf="item.certificationChannels==1">
          <text *ngIf="item.weChatAuthorizeState=='AUTHORIZE_STATE_AUTHORIZED'">已授权</text>
          <text *ngIf="item.weChatAuthorizeState=='AUTHORIZE_STATE_UNAUTHORIZED'">未授权</text>
        </div>
      </div>
      <div class="text-box">
        <text>商户名称：</text>
        <text>{{item.merchantName}}</text>
      </div>
      <div class="text-box">
        <text>实名人员：</text>
        <text>{{item.realName}}</text>
      </div>
      <div class="text-box">
        <text>渠道商户号：</text>
        <text>{{item.merchantId}}</text>
      </div>
    </div>
  </div>
</div>
  <div class="operate-the-container">
    <button nz-button nzType="primary" (click)="refresh()" [nzLoading]="nzLoading">刷新</button>
    <button nz-button nzType="primary" (click)="handleCancel()">关闭</button>
  </div>
</nz-modal>
